cmake_minimum_required(VERSION 3.0.2)
project(a02_task3)

find_package(Boost REQUIRED COMPONENTS thread filesystem)

find_package(catkin REQUIRED COMPONENTS
  message_generation
  roscpp
  rospy
  std_msgs
  ugv_sdk
  nav_msgs
)

add_message_files(
  FILES
  car_state.msg
  control_cmd.msg
)

generate_messages(
  DEPENDENCIES
  std_msgs
)

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES a02_task3
  CATKIN_DEPENDS message_runtime roscpp rospy std_msgs nav_msgs
#  DEPENDS system_lib
)

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
)

# LINK_DIRECTORIES(/home/agilex/catkin_ws/devel/lib)
# LINK_LIBRARIES(ugv_sdk)

add_executable(car_state_publisher src/car_state_publisher.cpp)
target_link_libraries(car_state_publisher ${catkin_LIBRARIES} ${Boost_LIBRARIES})


add_executable(cmd_control_publisher src/cmd_control_publisher.cpp)
target_link_libraries(cmd_control_publisher ${catkin_LIBRARIES} ${Boost_LIBRARIES})


add_executable(cmd_control_subscriber src/cmd_control_subscriber.cpp)
target_link_libraries(cmd_control_subscriber ${catkin_LIBRARIES} ${Boost_LIBRARIES})

add_executable(car_track_visualization src/car_track_visualization.cpp)
target_link_libraries(car_track_visualization ${catkin_LIBRARIES})

# http://wiki.ros.org/catkin/CMakeLists.txt#Executable_Targets
add_dependencies(car_state_publisher ${${PROJECT_NAME}_EXPORTED_TARGETS})
add_dependencies(cmd_control_subscriber ${${PROJECT_NAME}_EXPORTED_TARGETS})

# catkin_install_python(PROGRAMS scripts/server.py scripts/UI.py
#   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
